from django.utils.deprecation import MiddlewareMixin
import time


class MD1(MiddlewareMixin):
    def process_request(self, request):
        if '/api/CloudShop/' in request.path:
            time.sleep(1)
        return None

    def process_response(self, request, response):
        # 基于请求响应
        return response
